/**
 * API相关类型定义
 */

/**
 * 统一API响应格式
 */
export interface ApiResponse<T = any> {
  success: boolean;
  message: string;
  data?: T;
  error?: string;
  timestamp: string;
}

/**
 * 分页响应格式
 */
export interface PaginatedResponse<T = any> extends ApiResponse<T[]> {
  pagination: {
    page: number;
    limit: number;
    total: number;
    totalPages: number;
  };
}

/**
 * 验证错误响应
 */
export interface ValidationErrorResponse extends ApiResponse {
  errors: string[] | Record<string, string>;
}

/**
 * 分页查询参数
 */
export interface PaginationQuery {
  page?: number | string;
  pageSize?: number | string;
  limit?: number | string;
}

/**
 * 排序查询参数
 */
export interface SortQuery {
  sortBy?: string;
  sortOrder?: 'asc' | 'desc';
}

/**
 * 基础查询参数
 */
export interface BaseQuery extends PaginationQuery, SortQuery {
  search?: string;
  filter?: Record<string, any>;
}